-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit Post: Refactor effects to action generators #27069
Conversation
Size Change: -61 B (0%) Total Size: 1.2 MB
ℹ️ View Unchanged
|
53882b9
to
4d8cf8e
Compare
); | ||
|
||
// First remove any existing subscription in order to prevent multiple saves | ||
if ( !! saveMetaboxUnsubscribe ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this to work you'd need to declare let saveMetaboxUnsubscribe
outside of this function, right now this will always be false since the variable is undefined at this point. I think this doesn't throw an error only because const
is transpiled to var
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW this won't work with multiple registries. However, effects.js wouldn't as well so I don't think it's a blocker - just something to take note of for later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated that in 2e12440
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @adamziel, that makes sense 👍
This looks good overall, I left a few comments and there are some more tests failing, but it seems pretty close. Edit: Interestingly, in #27232 all the tests failed on CI. Still, the ones failing here worked in my local environment. I wonder what's the root cause. |
Thanks for taking a look @adamziel. I've been busy with other things these past couple of days, but I'll make sure to devote some time to this one tomorrow (Thursday). |
b983bd4
to
28e439b
Compare
FWIW we were missing the controls in the registry, but I addressed that in b983bd4 and that resolved one of the failing e2e tests. Looking into the other one now. |
@adamziel I think the problem was that with the new action generators the Let's see if the tests will pass this time 😉 |
They're green ✅ |
// We shouuld be able to make the switch once we remove the effects. | ||
const instantiatedStore = registerStore( STORE_NAME, storeConfig ); | ||
applyMiddlewares( instantiatedStore ); | ||
registerStore( STORE_NAME, storeConfig ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we'd find a way to use register() here, but it's not a blocker for this PR
Great work @tyxla, Thank you! |
Thanks for all the help and reviews @adamziel 🙌 |
Description
This PR migrates the
edit-post
store effects into action generators. See #25643.That allows us to also remove
refx
as a middleware for side effects, which this PR is also taking care of.How has this been tested?
Types of changes
Non-breaking code quality enhancement.
Checklist: